<?php
session_start();

require_once '../include/config.lib.php';
require_once '../include/database.lib.php';

$filename = $_GET['file']; //Get the filename
$properFilename = $_GET['properFilename'].'.'.$_GET['extension']; //The name that the file will be saved as locally

header("Content-Disposition: attachment; filename=\"".basename($properFilename)."\";" ); //force a file download
header("Content-Transfer-Encoding: binary");

//readfile("../../upload/2797701.pdf");
readfile($filename);
exit(); 

?>